OTSndDisconnect
Tears down an open connection (abortive disconnect) or rejects an incoming connection request.C INTERFACE
OSStatus OTSndDisconnect(EndpointRef ref, TCall* call);C++ INTERFACE
OSStatus TEndpoint::SndDisconnect(TCall* call);PARAMETERS
ref
- The endpoint reference for the endpoint tearing down the connection or rejecting the connection request.
call
- A pointer to a
TCall
structure that specifies the connection to be torn down or rejected, and specifies data sent with the disconnection request if the endpoint supports sending such data.
- The
call->addr
field and thecall->opt
field are reserved and should be set to 0.
- The
call->udata.buf
field is a pointer to a buffer containing data that you want to send with the disconnection request. Set thecall->udata.len
field to the size of the data. The amount of data should not exceed the limits supported by the endpoint, as returned in thediscon
field of theTEndpointInfo
structure.
- The
call->sequence
field should be set to a valid value to identify the request if you are using this function to reject a connection request. This field is ignored if you are using this function to tear down a connection.
- function result
- An error code. See Appendix B.
DISCUSSION
You can use theOTSndDisconnect
function to tear down a connection or to reject incoming connection requests. Whenever possible, use the functionOTSndOrderlyDisconnect
to tear down a connection.If the endpoint is in synchronous mode, the function returns when the operation is complete. If the endpoint is in asynchronous mode, the
OTSndDisconnect
function returns immediately with a result ofkOTNoError
to indicate that the disconnection process has begun and that your notifier function will be sent aT_DISCONNECTCOMPLETE
event when the process completes. Thecookie
parameter contains thecall
parameter.If you have not installed a notifier function, you cannot determine when this function completes. For more information on notifier functions and event codes, see
MyNotifierCallback
function and "Event Codes".
SEE ALSO
"TCP/IP Services".